﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="GetMessage.aspx.cs" Inherits="InformationSystem.WebSite.Module.NoticeMgr.GetMessage" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>学生信息事务服务系统</title>
    <link rel="stylesheet" type="text/css" media="all" href="../../css/style.css" />
    <link rel="Stylesheet" type="text/css" href="../../css/jquery-ui-1.7.1.custom.css" />
    <!--[if IE 7]><link rel="stylesheet" href="../../css/ie.css" type="text/css" media="screen, projection" /><![endif]-->
    <!--[if IE 6]><link rel="stylesheet" href="../../css/ie6.css" type="text/css" media="screen, projection" /><![endif]-->
    <link rel="stylesheet" type="text/css" href="../../css/markitup/style.css" />
    <link rel="stylesheet" type="text/css" href="../../css/markitup/default/style.css" />
    <link rel="stylesheet" type="text/css" href="../../css/superfish.css" media="screen" />
    <!--[if IE]>
		<style type="text/css">
		  .clearfix {
		    zoom: 1;     /* triggers hasLayout */
		    display: block;     /* resets display for IE/Win */
		    }  /* Only IE can see inside the conditional comment
		    and read this CSS rule. Don't ever use a normal HTML
		    comment inside the CC or it will close prematurely. */
		</style>
	<![endif]-->
    <!-- JavaScript -->
    <script type="text/javascript" src="../../Scripts/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery-ui-1.7.1.custom.min.js"></script>
    <script type="text/javascript" src="../../Scripts/hoverIntent.js"></script>
    <script type="text/javascript" src="../../Scripts/superfish.js"></script>
    <script type="text/javascript">
        // initialise plugins
        jQuery(function () {
            jQuery('ul.sf-menu').superfish();
        });

    </script>
    <script type="text/javascript" src="../../Scripts/excanvas.pack.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.flot.pack.js"></script>
    <script type="text/javascript" src="../../Scripts/jquery.markitup.pack.js"></script>
    <script type="text/javascript" src="../../Scripts/set.js"></script>
    <script type="text/javascript" src="../../Scripts/custom.js"></script>
    <!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.pack.js"></script><![endif]-->
    <script type="text/javascript">
        function printdiv(divobj) {
            var headstr = '<html><head></head><body>';
            var footstr = '</body>';
            var oldstr = document.body.innerHTML;
            var newstr = divobj.innerHTML;
            document.body.innerHTML = headstr + newstr + footstr;
            window.print();
            document.body.innerHTML = oldstr;
            //return false;
        }
	function popupUri(uri, width, height) {

            mywindow.clearContent();
            mywindow.setWidth(width);
            mywindow.setHeight(height);
            mywindow.center();
            mywindow.show();
            mywindow.load(uri)
        }
        var isaffiche = function () {
            return document.getElementById('hdntype').value == 'affiche';
        }

        var ismsg = function () {
            return document.getElementById('hdntype').value == 'msg';
        }
        var isworkinfo = function () {
            return document.getElementById('hdntype').value == 'workinfo';
        }

        function showreadlist() {
            mywindow.clearContent();
            mywindow.center();
            mywindow.show();
            var url = "ReadList.aspx?m=" + document.getElementById('hdntype').value + "&id=" + document.getElementById("hdnid").value;
            mywindow.load(url);
        }
        function updatecount(response, result) {
            var text = response;
            var responseArray = Ext.util.JSON.decode(result.responseText);
            document.getElementById('online').firstChild.textContent = "在线人数:" + responseArray.count;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" />
    <ext:ObjectHolder ID="ObjHolder1" runat="server" />
    <ext:XTemplate ID="ReplyTemplate" runat="server">
        <Html>
            <table style="width: 100%;">
            <tpl for=".">
            <tr  style="margin-top: 20px">
            <td><p style="text-align:left;">回复者:{ReplyUserName}</p></td>
            <td><p style="text-align:right">时间:{TimeFormatOuput}</p></td>
            </tr>
			<tr colspan="2" ><td  style="padding-left:70px">{Content}</td></tr>
			</tpl>
             </table>
        </Html>
    </ext:XTemplate>
    <ext:XTemplate ID="Attach" runat="server">
        <Html>
            <p>附件</p>
            <tpl for=".">
           <div style="margin-top: 4px;">
            <tpl if="isaffiche()">
            <a href="InformationAttachmentDownLoad.aspx?type=affiche&objectid={RefParentID}&fileid={FileID}">{UploadFileName}</a>
            </div>
			</tpl>
            <tpl if="ismsg()">
            <a href="InformationAttachmentDownLoad.aspx?type=msg&objectid={RefParentID}&fileid={FileID}">{UploadFileName}</a>
            </div>
			</tpl>
            <tpl if="isworkinfo()">
            <a href="InformationAttachmentDownLoad.aspx?type=workinfo&objectid={RefParentID}&fileid={FileID}">{UploadFileName}</a>
            </div>
			</tpl>
             </tpl>
            <p></p>
        </Html>
    </ext:XTemplate>
    <div class="container" id="container">
        <div id="header">
            <div id="profile_info">
                <img src="../../img/avatar.jpg" id="avatar" alt="avatar" />
                <p>
                    欢迎<a style="margin-left: 4px; margin-right: 10px" href="~/Panel.aspx"><%=user.UserName%></a><a
                        style="margin-right: 2px" href="~/Panel.aspx">设置</a></p>
                <p id="online" style="margin-top: 2px">
                    在线人数:0 <a style="margin-left: 5px;" href="javascript:void(0)" onclick="popupUri('Module/SecurityMgr/passwordchange.aspx',300,200)">
                        修改密码</a><a style="margin-left: 5px;" href="javascript:void(0)" onclick="window.location.href='Logout.aspx'">注销</a>
                </p>
                <p class="last_login" id="lastlogintime" runat="server">
                </p>
            </div>
            <div id="logo">
                <h1>
                    <a href="/">AdmintTheme</a></h1>
            </div>
        </div>
        <!-- end header -->
        <div id="content">
            <div id="top_menu" class="clearfix">
                <ul class="sf-menu">
                    <%-- <!-- DROPDOWN MENU -->
                    <li>
                        <div>
                            <a>文档->学生信息管理系统需求描述</a></div>
                    </li>--%>
                </ul>
                <div style="cursor: pointer;" onclick="window.close()">
                    <a id="visit" class="right">关闭页面</a></div>
            </div>
            <div id="myContent" runat="server" class="section">
                <div id="subjectlocation" runat="server" style="font-size: x-large; font-family: 黑体;
                    color: #133977; text-align: center; margin-bottom: 15px; margin-top: 10px;">
                </div>
                <div id="contentlocation" runat="server" style="margin-bottom: 15px; line-height: 30px">
                </div>
                <div id="keylocation" runat="server" style="font-size: 15px; font-family: 黑体;">
                </div>
                <div id="commitUser" runat="server" style="font-size: 15px; font-family: 黑体; text-align: right;
                    margin-right: 20px">
                </div>
            </div>
            <ext:Panel ID="attachmentlocation" runat="server" BodyStyle="background-color:#F8F8F8; padding:5px; border:dotted 1px gray;">
                <Listeners>
                    <Render Handler="#{Attach}.overwrite(this.body, #{ObjHolder1}.Attachment);" />
                </Listeners>
            </ext:Panel>
            <ext:Panel ID="relylocation" runat="server" BodyStyle="background-color:#F8F8F8; padding:5px; border:dotted 1px gray;">
                <Listeners>
                    <Render Handler="#{ReplyTemplate}.overwrite(this.body, #{ObjHolder1}.Reply);" />
                </Listeners>
            </ext:Panel>
            <%if (hdntype.Value == "msg") %>
            <%{ %>
            <ext:FormPanel runat="server" ID="replyPanel" HideLabel="true" Layout="FitLayout"
                Header="true" Title="回复">
                <Items>
                    <ext:HtmlEditor runat="server" ID="replycontent" Height="280" AnchorHorizontal="100%">
                    </ext:HtmlEditor>
                </Items>
                <TopBar>
                    <ext:Toolbar runat="server">
                        <Items>
                            <ext:Button Text="提交" runat="server">
                                <DirectEvents>
                                    <Click OnEvent="Reply_Click">
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                        </Items>
                    </ext:Toolbar>
                </TopBar>
            </ext:FormPanel>
            <%}%>
            <div id="print_menu" class="clearfix">
                <div style="cursor: pointer;">
                    <a class="visit2 left" style="margin-left: 10px" onclick="showreadlist()">点击查阅阅读记录</a>
                    <a class="visit2 right">下载</a> <a class="visit2 right" onclick="printdiv(myContent)">
                        打印</a></div>
            </div>
            <%--  <ext:Button ID="Button1" runat="server" Text="打印"></ext:Button>
    <ext:Button ID="Button2" runat="server" Text="下载"></ext:Button>--%>
        </div>
        <!-- end #content -->
        <div id="footer" class="clearfix">
            <p class="left">
                Power by 3161140 672598722</p>
            <p class="right">
                © 2012 NJUST, Some Rights Reserved.</p>
        </div>
        <!-- end #footer -->
    </div>
    <input type="hidden" runat="server" id="hdntype" name="hdntype" />
    <input type="hidden" runat="server" id="hdnid" name="hdnid" />
    <ext:Window runat="server" ID="mywindow" Width="600" Height="400" Hidden="true" Layout="FitLayout"
        Modal="true">
        <AutoLoad ShowMask="true" Mode="IFrame" MaskMsg="正在加载页面，请稍后...">
        </AutoLoad>
    </ext:Window>
    <ext:TaskManager runat="server" ID="taskmgr">
        <Tasks>
            <ext:Task TaskID="getusercountprogress" AutoRun="true">
                <DirectEvents>
                    <Update Url="~/UserOnline.aspx" Complete="updatecount(response,result)" Method="GET"
                        Delay="2000">
                    </Update>
                </DirectEvents>
            </ext:Task>
        </Tasks>
    </ext:TaskManager>
    </form>
</body>
</html>
